package com.janko.springbootbase.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.janko.springbootbase.mapper.UserMapper;
import com.janko.springbootbase.entity.BaseUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public BaseUser login(int uid) {
        BaseUser baseUser = new BaseUser().setAge(11).setId(1).setName("小明");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return baseUser;
    }



    @Override
    public java.util.List<BaseUser>  getAll() {
        System.out.println("无参数");
        return userMapper.getAll();
    }

    @Override
    public Page<BaseUser> selectUserPage(Page<BaseUser> page, String state) {
        page.setRecords(userMapper.selectUserList(page,state));
        return page;
    }
}





